% function to supress outliers
% if it is more thn x times the median
% of the the input vector
% the value then gets it's half


function[X] = MedOut(X,factor),

l = find(X)>0;
p = median(X(l));
n = length(X);

for i = 1:n,
   if X(i) > p*factor,
            X(i) = X(i)/factor;;
     % X(i) = p;
   end;
end;

 

